package org.simple.framework.web.result.base;

import lombok.Getter;
import org.simple.framework.web.result.model.BaseCode;

/**
 * 项目名称：simple-framework
 * 类名称：SimpleResultCode
 * 类描述：SimpleResultCode
 * 创建时间：2018/11/26
 *
 * @author sisyphus   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
@Getter
public enum SimpleResultCode implements BaseCode {

    SUCCESS(200, "成功", true),
    BAD_REQUEST(400, "请求参数异常"),
    UNAUTHORIZED(401, "您未登录或者登录已超时"),
    FORBIDDEN(403, "没有权限"),
    LOCKED(423, "用户已被锁定"),
    INTERNAL_SERVER_ERROR(500, "服务异常"),
    NOT_IMPLEMENTED(501, "不支持的请求"),
    DATA_EXCEPTION(999, "数据异常");

    /**
     * 返回状态码
     */
    private Integer code;
    /**
     * 返回消息
     */
    private String message;
    /**
     * 是否成功
     */
    private Boolean isSuccess;

    SimpleResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
        this.isSuccess = false;
    }

    SimpleResultCode(Integer code, String message, Boolean isSuccess) {
        this.code = code;
        this.message = message;
        this.isSuccess = isSuccess;
    }

}
